Optimal. Leaf size=100 \[ \frac {5 \tanh ^{-1}(\sin (c+d x))}{8 a^2 d}+\frac {5 \sec (c+d x) \tan (c+d x)}{8 a^2 d}+\frac {5 \sec ^3(c+d x) \tan (c+d x)}{12 a^2 d}-\frac {2 i \sec ^5(c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3581, 3853,
3855} \begin {gather*} \frac {5 \tanh ^{-1}(\sin (c+d x))}{8 a^2 d}-\frac {2 i \sec ^5(c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {5 \tan (c+d x) \sec ^3(c+d x)}{12 a^2 d}+\frac {5 \tan (c+d x) \sec (c+d x)}{8 a^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3581
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \frac {\sec ^7(c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=-\frac {2 i \sec ^5(c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {5 \int \sec ^5(c+d x) \, dx}{3 a^2}\\ &=\frac {5 \sec ^3(c+d x) \tan (c+d x)}{12 a^2 d}-\frac {2 i \sec ^5(c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {5 \int \sec ^3(c+d x) \, dx}{4 a^2}\\ &=\frac {5 \sec (c+d x) \tan (c+d x)}{8 a^2 d}+\frac {5 \sec ^3(c+d x) \tan (c+d x)}{12 a^2 d}-\frac {2 i \sec ^5(c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {5 \int \sec (c+d x) \, dx}{8 a^2}\\ &=\frac {5 \tanh ^{-1}(\sin (c+d x))}{8 a^2 d}+\frac {5 \sec (c+d x) \tan (c+d x)}{8 a^2 d}+\frac {5 \sec ^3(c+d x) \tan (c+d x)}{12 a^2 d}-\frac {2 i \sec ^5(c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(215\) vs. \(2(100)=200\).
time = 1.19, size = 215, normalized size = 2.15 \begin {gather*} -\frac {\sec ^4(c+d x) \left (128 i \cos (c+d x)+45 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+60 \cos (2 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+15 \cos (4 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-45 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+18 \sin (c+d x)-30 \sin (3 (c+d x))\right )}{192 a^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 170, normalized size = 1.70
method | result | size |
risch | \(-\frac {i \left (15 \,{\mathrm e}^{7 i \left (d x +c \right )}+55 \,{\mathrm e}^{5 i \left (d x +c \right )}+73 \,{\mathrm e}^{3 i \left (d x +c \right )}-15 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{12 d \,a^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 a^{2} d}+\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 a^{2} d}\) | \(111\) |
derivativedivides | \(\frac {\frac {2 \left (\frac {3}{16}+\frac {i}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\frac {2 \left (\frac {1}{16}+\frac {i}{2}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {2 \left (-\frac {1}{4}+\frac {i}{3}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {5 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8}+\frac {2 \left (\frac {3}{16}-\frac {i}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\frac {2 \left (-\frac {1}{16}+\frac {i}{2}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {2 \left (-\frac {1}{4}-\frac {i}{3}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {5 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8}}{a^{2} d}\) | \(170\) |
default | \(\frac {\frac {2 \left (\frac {3}{16}+\frac {i}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\frac {2 \left (\frac {1}{16}+\frac {i}{2}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {2 \left (-\frac {1}{4}+\frac {i}{3}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {5 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8}+\frac {2 \left (\frac {3}{16}-\frac {i}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\frac {2 \left (-\frac {1}{16}+\frac {i}{2}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {2 \left (-\frac {1}{4}-\frac {i}{3}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {5 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8}}{a^{2} d}\) | \(170\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 295 vs. \(2 (88) = 176\).
time = 0.30, size = 295, normalized size = 2.95 \begin {gather*} \frac {\frac {2 \, {\left (\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {16 i \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {33 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {48 i \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {33 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {48 i \, \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {9 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - 16 i\right )}}{a^{2} - \frac {4 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {6 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {4 \, a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {a^{2} \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}} + \frac {15 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{2}} - \frac {15 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{2}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 230 vs. \(2 (88) = 176\).
time = 0.38, size = 230, normalized size = 2.30 \begin {gather*} \frac {15 \, {\left (e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 15 \, {\left (e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 30 i \, e^{\left (7 i \, d x + 7 i \, c\right )} - 110 i \, e^{\left (5 i \, d x + 5 i \, c\right )} - 146 i \, e^{\left (3 i \, d x + 3 i \, c\right )} + 30 i \, e^{\left (i \, d x + i \, c\right )}}{24 \, {\left (a^{2} d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, a^{2} d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {\sec ^{7}{\left (c + d x \right )}}{\tan ^{2}{\left (c + d x \right )} - 2 i \tan {\left (c + d x \right )} - 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.84, size = 151, normalized size = 1.51 \begin {gather*} \frac {\frac {15 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {15 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} + \frac {2 \, {\left (9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 48 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 33 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 48 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 33 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 16 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 16 i\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4} a^{2}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.92, size = 136, normalized size = 1.36 \begin {gather*} \frac {5\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,a^2\,d}+\frac {\frac {3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,4{}\mathrm {i}-\frac {11\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,4{}\mathrm {i}-\frac {11\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{4}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,4{}\mathrm {i}}{3}+\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}-\frac {4}{3}{}\mathrm {i}}{a^2\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________